public class ColorCodes
{
   /**
      Returns the code of the given image when doubled in size
      @param img the codes of an image
      @return the color codes of the doubled image
   */
   public String doubleImage(String img)
   {   
      String result = "";
      String word = "";
      for (int i = 0; i < img.length(); i++)
      {
          char ch = img.charAt(i);
          if (ch == '\n')
          {
             // your work here
             result += word + ch;
             result += word + ch;
             word = "";
          }
          else
          {
             // your work here
             word += ch;
             word += ch;
          }          
      }
      return result;
   }  
}